package main

import "fmt"

func visit(nums []int, callback func(int)) {
	for _, num := range nums {
		callback(num)
	}
}

func main() {
	nums := []int{1, 3, 4, 5, 6, 7, 9}
	visit(nums, func(i int) {
		fmt.Println(i)
	})

}
